import { Application } from "pixi.js";
import { useFileStore } from "../../Views/Files/files";
import { Canvas } from "./Canvas";
export const createCanvas = (canvas: HTMLCanvasElement) => {
    let app = new Application({
        antialias: false,
        backgroundColor: 0xffffff,
        view: canvas,
        resizeTo: canvas.parentElement!,
        autoDensity: true,
    });

    app.stage.sortableChildren = true;
    const file = useFileStore().openingFile!;
    const _canvas = new Canvas(app, file.width, file.height)
        .mount()
        .loadFile(file);

    _canvas.scale = 5;

    return _canvas;
};
